import pandas as pd
import numpy as np
import random

# DNA_SIZE = 24
# POP_SIZE = 200
# CROSSOVER_RATE = 0.8
# MUTATION_RATE = 0.005
# N_GENERATIONS = 50
# X_BOUND = [-3, 3]
# Y_BOUND = [-3, 3]
# pop = np.random.randint(2, size=(POP_SIZE, DNA_SIZE*2))
# x_pop = pop[:,1::2]#奇数列表示X
# x = x_pop.dot(2**np.arange(DNA_SIZE)[::-1])/float(2**DNA_SIZE-1)*(X_BOUND[1]-X_BOUND[0])+X_BOUND[0]
# # print(x_pop)
# # print(x_pop.shape)
# print(x)
# print(x.shape)
print(random.uniform(-3, 3))


# x_mat = pd.read_excel(r'./data/topsis.xlsx', usecols=[1,2,3,4])
# position = np.array([int(i) for i in input("请输入需要正向化处理的指标所在的列,例如第1、3、4列需要处理,则输入1,3,4   ").split(',')])
# position = position-1
# print(position)
# typ = np.array([int(j) for j in input("请按照顺序输入这些列的指标类型(1:极小型,2:固定型,3:区间型)格式同上    ").split(',')])
# print(typ)
# for k in range(position.shape[0]):
#     print(x_mat.iloc[:, position[k]])

# print(float('Inf'))
# pos = np.random.uniform(30, 30, (1, 1))
# a = sum(100.0 * (pos[0][1:] - pos[0][:-1] ** 2.0) ** 2.0 + (1 - pos[0][:-1]) ** 2.0)
# print(pos)
# print(a)

# W = 1
# C1 = 2
# C2 = 2

# get_pos = np.random.uniform(-30, 30, (1, 4))   
# get_vel = np.random.uniform(-60, 60, (1, 4))
# get_best_pos = np.zeros((1, 4))
# get_bestPosition = np.zeros((1, 4))
# print(get_pos)
# print(get_vel)
# print(get_best_pos)
# print(get_bestPosition)
# vel_value = W * get_vel + C1 * np.random.rand() * (get_best_pos - get_pos) \
#                 + C2 * np.random.rand() * (get_bestPosition - get_pos)
# print(vel_value)
# vel_value[vel_value > 60] = 60
# print(vel_value)
# vel_value[vel_value < -60] = -60
# print(vel_value)
